package com.example.druid.demo_druid.asynctask;

import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Component;

import java.util.concurrent.Future;

/**
 * @author 奶茶
 * Created by on 2018/3/14.
 */
@Component
public class TestTask {

    @Async
    public Future<String> test(){
        try {
            Thread.sleep(50000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new AsyncResult<String>("123132");
    }

}
